package adv328;
import adv327.Sex;
import adv327.Student;

import java.util.*;
/**
 * @author oldliu
 * @since 1.0
 */
public class ListDemo5 {
    public static void main(String[] args) {
        List<String> l=new ArrayList<>();
        l.add("老虎");
        l.add("pig");
        l.add("dog");
        l.add("奶牛");
        l.add("斑马");
        l.add("企鹅");
        //从小到大
        Collections.sort(l);
        System.out.println(l);
        String max = Collections.max(l);
        String min = Collections.min(l);
        System.out.println(max);
        System.out.println(min);
        System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
        List<Student> l2=new ArrayList<>();
        l2.add(new Student("王智睿",18, Sex.男));
        l2.add(new Student("胡汪洋",27, Sex.男));
        l2.add(new Student("yiwenlong",22, Sex.男));
        l2.add(new Student("赵俊杰",17, Sex.男));
        Student mm = Collections.min(l2);
        System.out.println("Zui xiao:"+mm);
        Collections.sort(l2);//max,min

        for(Student student:l2)
            System.out.println(student);

        System.out.println("abc".compareTo("kh"));
    }
}
